package org.example.spring.self.demo.s3;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;

/**
 * 文件描述
 *
 * @author yezhou41127
 * @date: 2022年08月01日
 */
@Component
public class LifeCycleBean {

	public LifeCycleBean() {
		System.out.println("构造");
	}

	@Autowired
	public void autowire(@Value("${JAVA_HOME}") String javaHome) {
		System.out.println("Autowired:"+ javaHome);
	}

	@PostConstruct
	public void init() {
		System.out.println("初始化");
	}

	@PreDestroy
	public void destroy() {
		System.out.println("销毁");
	}
}
